package prefix.payment;

import java.util.List;

import processor.PayProcessor;
import models.Pay;
import repository.PayRepository;
import service.exception.PayException;

public class PaymentNotifyProcessor {

    public static void processTodayNotification() {
        List<Pay> notifyList = PayRepository.getTodayNotification();
        System.out.println("payment to notify : " + notifyList.size());
        for (Pay pay : notifyList) {
            paymentNotify(pay);
        }
    }

    private static void paymentNotify(Pay pay) {
        try {
            PayProcessor processor = new PayProcessor(pay);
            processor.validateForNotify();
            processor.paymentNotify();
        } catch (PayException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
